<template>
	<div class="outer">
    <headers @back-click="back()" :headers="headers"></headers>
		<scroll :topArea="44" ref="discoverInfo" :pullDownRefresh="false" :pullUpLoad="false" :data="serviceContent">
        <div class="content-wrapper">
          <div v-html="serviceContent[0]"></div>
        </div>
  	</scroll>
	</div>
</template>

<script>
import {getInfoContent} from "@/api/homepage.js"
export default {
  name: 'discoverInfo',
  components: {
  },
  data: function(){
    return {
      headers: {
        title: ""
      },
      serviceContent: []
    }
  },
  methods: {
    back: function(){
      this.$router.go(-1);
    },
    infoContent: function(){
      getInfoContent(this.$route.params.id).then( data => {
        if(data.code == 200){
          this.serviceContent.push(data.data.content);
          this.headers.title = data.data.title;
        }else {
          this.$vux.toast.show({
            text: data.message,
            time: 1000,
            width: 'auto',
            // position: 'middle'
          })
        }
      })
    }
  },
  mounted: function(){
    this.infoContent();
  }
}
</script>

<style lang="scss" scoped>
	.outer {
		  height: 100%;
    	width: 100%;
    	position: absolute;
	}
</style>